package xyz.jcat.security;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.List;

public class UserRoleAuthenticationToken extends AbstractAuthenticationToken {

    private Long userId;
    private List<Long> roleIds;

    public UserRoleAuthenticationToken(Collection<? extends GrantedAuthority> authorities) {
        super(authorities);
    }

    public UserRoleAuthenticationToken(Long userId, List<Long> roleIds) {
        super(null);
        this.userId = userId;
        this.roleIds = roleIds;
    }

    public UserRoleAuthenticationToken() {
        super(null);
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return null;
    }

    public List<Long> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
}
